package com.qmerak.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qmerak.entity.OrgEntity;
import com.qmerak.entity.OrgHonourEntity;
import com.qmerak.service.IOrgHonourService;

/**
 * @author Shaohong•Cheng
 * @mail shaohong726@126.com
 * @date 2013-4-21
 * @project TUManager
 */
@Controller
@RequestMapping("/org/honour")
public class OrgHonourAction {
	@Autowired
	private IOrgHonourService orgHonourService;

	@ResponseBody
	@RequestMapping(value = "add", method = RequestMethod.POST)
	public void add(OrgHonourEntity entity) {
		orgHonourService.add(entity);
	}

	@ResponseBody
	@RequestMapping(value = "update", method = RequestMethod.POST)
	public void update(OrgHonourEntity entity) {
		orgHonourService.update(entity);
	}

	@ResponseBody
	@RequestMapping(value = "delete", method = RequestMethod.POST)
	public void delete(OrgHonourEntity entity) {
		orgHonourService.delete(entity);
	}

	@ResponseBody
	@RequestMapping(value = "find", method = RequestMethod.GET)
	public List<OrgHonourEntity> honoursOfOrg(OrgEntity entity) {
		return orgHonourService.honoursOfOrg(entity);
	}
}
